<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="/public/css/style.css">
</head>
<body>
    <h1>测试列子</h1>
    <p><%=name%></p>
    <p><%=time%> 时间戳转换 <%=helper.fromatTime(time)%></p>
    <img src="/public/image/timg.png" alt="">
    <form method="POST" action="/add?_csrf=<%=csrf%>">
        <input type="text" name="title" value="1111" />
        <button type="submit">add</button>
    </form>
    <!-- https://juejin.im/entry/59b126c46fb9a02487556964  socket.io官方文档中文版-->
    <script src="/public/js/dist/socket.io.js"></script>
    <script>
            var socket = io('http://127.0.0.1:7001');

            socket.on('connect', function() {
                console.log('链接成功')
            });

            socket.on('res', msg => {
                console.log('我是客户端1:'+ msg);
            });
          
            setTimeout(function(){
                socket.emit('chat', '我是客户端的数据2');
            },3000)  
            setTimeout(function(){
                socket.emit('chat', '我是客户端的数据3');
            },6000)
    </script>
</body>
</html>